package com.mail.model.vo;

import com.mail.model.db.OmsOrder;
import com.mail.model.db.OmsOrderItem;
import com.mail.model.db.OmsOrderOperateHistory;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

import java.io.Serializable;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class OrderDetailsVo extends OmsOrder implements Serializable {
    private List<OmsOrderOperateHistory> historyList;
    private List<OmsOrderItem> orderItemList;

    public static OrderDetailsVo init(OmsOrder order, List<OmsOrderOperateHistory> list, List<OmsOrderItem> orderItemList) {
        OrderDetailsVo vo = new OrderDetailsVo();
        BeanUtils.copyProperties(order, vo);
        vo.setHistoryList(list);
        vo.setOrderItemList(orderItemList);
        return vo;
    }
}
